package com.qd.common.panda.domain.entity.shop.order;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单优惠记录
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class ProductOrderPreferentialLogDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "记录ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "记录ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String logId;
    /**
     * 第三方订单ID
     */
    @Size(max = 64, message = "第三方订单ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String thirdPartyOrderId;
    /**
     * 金额
     */
    private BigDecimal price;
    /**
     * 折扣
     */
    private Double customerDiscount;
    /**
     * 优惠金额:这一单优惠了多少钱
     */
    private BigDecimal discountAmount;
    /**
     * 添加时间
     */
    private LocalDateTime addTime;
    /**
     * 排序
     */
    private Integer idx;
    /**
     * 订单ID
     */
    @Size(max = 50, message = "订单ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String orderId;
    /**
     * 优惠种类
     */
    @Size(max = 50, message = "优惠种类长度不能超过{max}位", groups = DefaultGroup.class)
    private String preferentialCategory;

    @Override
    public void freeData() {
        this.logId = null;
        this.thirdPartyOrderId = null;
        this.price = null;
        this.customerDiscount = null;
        this.discountAmount = null;
        this.addTime = null;
        this.idx = null;
        this.orderId = null;
        this.preferentialCategory = null;
        super.freeData();
    }
}
